package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName device_info
 */
@TableName(value ="device_info")
@Data
public class DeviceInfo {
    /**
     * 
     */
    @TableId(value = "device_id", type = IdType.AUTO)
    private Integer deviceId;

    /**
     * 
     */
    @TableField(value = "device_name")
    private String deviceName;

    /**
     * 
     */
    @TableField(value = "category_id")
    private Integer categoryId;

    /**
     * 
     */
    @TableField(value = "model")
    private String model;

    /**
     * 
     */
    @TableField(value = "specification")
    private String specification;

    /**
     * 
     */
    @TableField(value = "manufacturer")
    private String manufacturer;

    /**
     * 
     */
    @TableField(value = "purchase_date")
    private Date purchaseDate;

    /**
     * 
     */
    @TableField(value = "purchase_price")
    private BigDecimal purchasePrice;

    /**
     * 
     */
    @TableField(value = "warranty_period")
    private Integer warrantyPeriod;

    /**
     * 
     */
    @TableField(value = "installation_location")
    private String installationLocation;

    /**
     * 
     */
    @TableField(value = "responsible_person_id")
    private Integer responsiblePersonId;

    /**
     * 
     */
    @TableField(value = "status")
    private Object status;

    /**
     * 
     */
    @TableField(value = "last_maintenance_date")
    private Date lastMaintenanceDate;

    /**
     * 
     */
    @TableField(value = "next_maintenance_date")
    private Date nextMaintenanceDate;

    /**
     * 
     */
    @TableField(value = "maintenance_cycle")
    private Integer maintenanceCycle;

    /**
     * 
     */
    @TableField(value = "device_code")
    private String deviceCode;

    /**
     * 
     */
    @TableField(value = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceInfo other = (DeviceInfo) that;
        return (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getModel() == null ? other.getModel() == null : this.getModel().equals(other.getModel()))
            && (this.getSpecification() == null ? other.getSpecification() == null : this.getSpecification().equals(other.getSpecification()))
            && (this.getManufacturer() == null ? other.getManufacturer() == null : this.getManufacturer().equals(other.getManufacturer()))
            && (this.getPurchaseDate() == null ? other.getPurchaseDate() == null : this.getPurchaseDate().equals(other.getPurchaseDate()))
            && (this.getPurchasePrice() == null ? other.getPurchasePrice() == null : this.getPurchasePrice().equals(other.getPurchasePrice()))
            && (this.getWarrantyPeriod() == null ? other.getWarrantyPeriod() == null : this.getWarrantyPeriod().equals(other.getWarrantyPeriod()))
            && (this.getInstallationLocation() == null ? other.getInstallationLocation() == null : this.getInstallationLocation().equals(other.getInstallationLocation()))
            && (this.getResponsiblePersonId() == null ? other.getResponsiblePersonId() == null : this.getResponsiblePersonId().equals(other.getResponsiblePersonId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getLastMaintenanceDate() == null ? other.getLastMaintenanceDate() == null : this.getLastMaintenanceDate().equals(other.getLastMaintenanceDate()))
            && (this.getNextMaintenanceDate() == null ? other.getNextMaintenanceDate() == null : this.getNextMaintenanceDate().equals(other.getNextMaintenanceDate()))
            && (this.getMaintenanceCycle() == null ? other.getMaintenanceCycle() == null : this.getMaintenanceCycle().equals(other.getMaintenanceCycle()))
            && (this.getDeviceCode() == null ? other.getDeviceCode() == null : this.getDeviceCode().equals(other.getDeviceCode()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getModel() == null) ? 0 : getModel().hashCode());
        result = prime * result + ((getSpecification() == null) ? 0 : getSpecification().hashCode());
        result = prime * result + ((getManufacturer() == null) ? 0 : getManufacturer().hashCode());
        result = prime * result + ((getPurchaseDate() == null) ? 0 : getPurchaseDate().hashCode());
        result = prime * result + ((getPurchasePrice() == null) ? 0 : getPurchasePrice().hashCode());
        result = prime * result + ((getWarrantyPeriod() == null) ? 0 : getWarrantyPeriod().hashCode());
        result = prime * result + ((getInstallationLocation() == null) ? 0 : getInstallationLocation().hashCode());
        result = prime * result + ((getResponsiblePersonId() == null) ? 0 : getResponsiblePersonId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getLastMaintenanceDate() == null) ? 0 : getLastMaintenanceDate().hashCode());
        result = prime * result + ((getNextMaintenanceDate() == null) ? 0 : getNextMaintenanceDate().hashCode());
        result = prime * result + ((getMaintenanceCycle() == null) ? 0 : getMaintenanceCycle().hashCode());
        result = prime * result + ((getDeviceCode() == null) ? 0 : getDeviceCode().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", deviceId=").append(deviceId);
        sb.append(", deviceName=").append(deviceName);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", model=").append(model);
        sb.append(", specification=").append(specification);
        sb.append(", manufacturer=").append(manufacturer);
        sb.append(", purchaseDate=").append(purchaseDate);
        sb.append(", purchasePrice=").append(purchasePrice);
        sb.append(", warrantyPeriod=").append(warrantyPeriod);
        sb.append(", installationLocation=").append(installationLocation);
        sb.append(", responsiblePersonId=").append(responsiblePersonId);
        sb.append(", status=").append(status);
        sb.append(", lastMaintenanceDate=").append(lastMaintenanceDate);
        sb.append(", nextMaintenanceDate=").append(nextMaintenanceDate);
        sb.append(", maintenanceCycle=").append(maintenanceCycle);
        sb.append(", deviceCode=").append(deviceCode);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}